//
//  DWSwiftApp.swift
//  DWSwift
//
//  Created by GDL on 2025/6/17.
//

import SwiftUI
import SwiftfulRouting
@main
struct DWSwiftApp: App {
    
    @StateObject private var loadStateManager:DWGlobalLoadingState = DWGlobalLoadingState.shared
    
    private let networkingInstance:DWNetworkingConfig?
    
    init() {
        // APP 初始化
        print("初始化")
        // 网络配置
        self.networkingInstance = DWNetworkingConfig()
    }
    
    var body: some Scene {
        WindowGroup {
            RouterView(addNavigationView: true,content:{ router in
                DWTabBarView().onAppear(){
                    if(DWRouterManager.shared.router == nil){
                        DWRouterManager.shared.router = router
                    }
                }
            }).overlay(DWGlobalLoadingView(isLoading: $loadStateManager.isLoading))
        }
    }
}
